package com.ucode.model.cgms.enums;

import cn.hutool.core.util.ArrayUtil;
import com.ucode.tool.base.IntArrayValuable;

import java.util.Arrays;

/**
 * 陪玩用户押金状态枚举
 * @author liliang
 * @date: 2019年12月6日 上午11:05:25
 */
public enum CgmsCompanionUserDepositStateEnum implements IntArrayValuable {

    WAIT(1, "待缴纳"),
    PAY(2, "已缴纳"),
    REFUND(3, "押金已退");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CgmsCompanionUserDepositStateEnum::getCode).toArray();

    public Integer code;

    public String message;

    CgmsCompanionUserDepositStateEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static CgmsCompanionUserDepositStateEnum getByCode(Integer code) {
        return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}